<#import "html-macro.ftl" as h />
<#import "declaration-macro.ftl" as d />
<#--<form class="ui large allform">-->
<input type="hidden" name="id" value="${declaration.id!""}"/>
<input type="hidden" name="tempAttachmentBillNo" value="${declaration.id!""}"/>
<input type="hidden" name="declaration_type" value="${type!"E"}"/>
<input type="hidden" name="tradeType" value="${declaration.tradeType!"0"}"/>
<input type="hidden" name="seller" value="${declaration.seller}"/>
<input type="hidden" name="seller_address" value="${declaration.seller_address}"/>
<input type="hidden" name="seller_phone" value="${declaration.seller_phone}"/>
<input type="hidden" name="seller_fax" value="${declaration.seller_fax}"/>
<div class="ui inline form segment">
    <div class="ui grid topform">
        <div class="row">
        <@h.label  width="2" value=d.declarationTypeName__+"口岸" required=true />
        <@h.dropdown width="3" name="export_port_code" showName="export_port" value="${declaration.export_port_code}" showValue="${declaration.export_port}" />
        <@h.label width="2" value="申报口岸" required=true />
        <@h.dropdown width="4" name="declaration_port_code" showName="declaration_port" value="${declaration.declaration_port_code}" showValue="${declaration.declaration_port}"/>
        <@h.label width="2" value="报关行" width="two"  required=true />
        <@h.dropdown width="3" name="supCompany.id" showName="companyIdShowName" value="${declaration.supCompany.id}" showValue="${declaration.supCompany.name}" placeholder="请先选择申报口岸"/>
        <@h.blankPlaceholder width="8" id="supCompany_quotPrice"/>
        <#--<@h.label width="2" value="业务编号" />
        <@h.input width="3" name="business_number"/>-->
        <#if d.declarationType__>
        </#if>
        </div>
    </div>
    <div class="ui error message"></div>
</div>
<div id="errorMsg" class="ui error message" style="display: none"></div>
<div class="ui inline form segment">
    <div class="ui grid allform">
        <div class="row">
        <@h.label width="2" value="备案号" />
        <#if !d.isGeneralTrade__>
            <@h.input width="3" name="record_id"/>
        <#else>
            <@h.input width="3" name="record_id" readonly=true/>
        </#if>
        <@h.label class="fix1px" width="2" value="合同协议号" required=true/>
        <@h.input class="fixlpx" width="4" name="contract_no" value="${declaration.contract_no}"/>
        <@h.label width="2" value="签约地点" />
        <@h.input width="3" name="singing_place" value="${((declaration.singing_place)?length > 0)?string(declaration.singing_place,'佛山')}"/>
        <@h.label width="2" value="签约日期" />
        <@h.input width="3" name="contract_date" value="${declaration.contract_date?string('yyyy-MM-dd')}" onclick="WdatePicker();"/>
        <@h.label  width="2" value="发票号" required=true/>
        <@h.input width="4" name="invoice_no" value="${declaration.invoice_no}"/>
        <@h.label width="2" value=d.declarationTypeName__+"日期" />
        <@h.input width="3" name="export_date" value="${declaration.export_date?string('yyyy-MM-dd')}" onclick="WdatePicker();"/>
        <@h.label width="2" value="申报日期" />
        <@h.input width="3" name="report_date" readonly=true value="${declaration.report_date?string('yyyy-MM-dd')}"/>
        <@h.label  width="2"value="收发货人（卖方）" required=true />
        <@h.dropdown width="4" name="company_co" value="${declaration.company_co}" placeholder="单位编号或中文名称"/>
        <@h.input width="2" name="company_co_unite" value="${declaration.company_co_unite}"/>
        <@h.input width="3" name="company_name" value="${declaration.company_name}"/>
        <@h.label width="2" value="外商（买方）" required=true/>
        <@h.input width="3" name="buyer" value="${declaration.buyer}"/>
        <@h.label width="2" value=d.declarationType__?string("生产销售单位","消费使用单位") required=true />
        <@h.dropdown width="4" name="fahuo_company_co" value="${declaration.fahuo_company_co}" placeholder="单位编号或中文名称"/>
        <@h.input width="2" name="fahuo_company_co_unite" value="${declaration.fahuo_company_co_unite}"/>
        <@h.input width="3" name="fahuo_company_name" value="${declaration.fahuo_company_name}"/>
        <@h.label width="2" value="运输方式" />
        <@h.dropdown width="3" name="transport_mode_code" showName="transport_mode" showValue="${((declaration.transport_mode)?length > 0)?string(declaration.transport_mode,'水路运输')}" value="${((declaration.transport_mode_code)?length > 0)?string(declaration.transport_mode_code,'2')}"/>
        <@h.label width="2" value="运输工具名称"  />
        <@h.input width="4" name="transport_na" value="${declaration.transport_na}"/>
        <@h.label width="2" value="航次号" />
        <@h.input width="3" name="voyage_no" value="${declaration.voyage_no}"/>
        <@h.label width="2" value="提运单号" />
        <@h.input width="3" name="bl_no"  value="${declaration.bl_no}"/>
        <@h.label  width="2" value="监管方式" required=true />
        <@h.dropdown width="4" name="trade_mode_code" showName="trade_mode" value="${((declaration.trade_mode_code)?length > 0)?string(declaration.trade_mode_code,'0110')}" showValue="${declaration.trade_mode}" />
        <@h.label  width="2" value="征免性质" required=true />
        <@h.dropdown width="3" name="levymode_code" showName="levymode" value="${((declaration.levymode_code)?length > 0)?string(declaration.levymode_code,'101')}" showValue="${declaration.levymode}" />

        <@h.label width="2" value=d.declarationType__?string("运抵国","启运国") required=true />
        <@h.dropdown width="3" name="arrived_country_code" showName="arrived_country" value="${declaration.arrived_country_code}" showValue="${declaration.arrived_country}"/>
        <@h.label  width="2" value="贸易国" required=true />
        <@h.dropdown width="4" name="trading_country_code" showName="trading_country" value="${declaration.trading_country_code}" showValue="${declaration.trading_country}" />
        <@h.label  width="2" value=d.declarationType__?string("指运港","装货港") required=true />
        <@h.dropdown width="3" name="arrived_port_code" showName="arrived_port" value="${declaration.arrived_port_code}" showValue="${declaration.arrived_port}"/>
        <@h.label width="2" value="件数" required=true />
        <@h.input width="3" name="goods_count" value="${declaration.goods_count}"/>
        <@h.label width="2" value="包装种类" required=true />
        <#--对象缺code-->
        <@h.dropdown width="4" name="goods_package_code" showName="goods_package" value="${declaration.goods_package}" asValue=true />
        <@h.label  width="2" value="成交方式" required=true />
        <@h.dropdown width="3" name="deal_mode_code" showName="deal_mode" value="${((declaration.deal_mode)?length>0)?string(declaration.deal_mode,(d.declarationType__?string('FOB', 'CIF')))}" asValue=true/>


        <@h.label  width="2" value="运费" class="cost-hide"/>
        <@h.dropdown width="3" class="cost-hide" name="freight1_code" showName="freight1" value="${declaration.freight1}" placeholder="--计算类型--" asValue=true/>
        <@h.input width="2" name="freight2" class="cost-hide" value="${declaration.freight2}" placeholder="--数量--"/>
        <@h.dropdown width="4" class="cost-hide" name="freight3_code" showName="freight3" value="${declaration.freight3}" placeholder="--币制--" asValue=true  />
        <#--<@h.label width="2" value="报关单类型" required=true />
        <@h.dropdown width="4" name="customs_type_code" showName="customs_type" value="${((declaration.customs_type)?length>0)?string(declaration.customs_type,'通关无纸化')}" asValue=true />-->
        <@h.label width="2" value="毛重(KG)" required=true />
        <@h.input width="3" name="gross_weight" value="${declaration.gross_weight}"/>
        <@h.label  width="2" value="保费" class="cost-hide"/>
        <@h.dropdown width="3" class="cost-hide" name="premium1_code" showName="premium1" value="${declaration.premium1}" placeholder="--计算类型--" asValue=true />
        <@h.input width="2" class="cost-hide" name="premium2" value="${declaration.premium2}" placeholder="--数量--"/>
        <@h.dropdown width="4" class="cost-hide" name="premium3_code" showName="premium3" value="${declaration.premium3}" placeholder="--币制--" asValue=true />
        <@h.label width="2" value="净重(KG)" required=true />
        <@h.input width="4" name="net_weight" value="${declaration.net_weight}"/>


        <@h.label  width="2" value="杂费" class="cost-hide"/>
        <@h.dropdown width="3" class="cost-hide" name="otherfee1_code" showName="otherfee1" value="${declaration.otherfee1}" placeholder="--计算类型--" asValue=true />
        <@h.input width="2" class="cost-hide" name="otherfee2" value="${declaration.otherfee2}" placeholder="--数量--"/>
        <@h.dropdown width="4" class="cost-hide" name="otherfee3_code" showName="otherfee3" value="${declaration.otherfee3}" placeholder="--币制--" asValue=true />
        <@h.label  width="2" value="许可证号" />
        <@h.input width="3" name="license_no" value="${declaration.license_no}"/>
        <@h.label width="2" value="报关单类型" required=true />
        <@h.dropdown width="3" name="customs_type_code" showName="customs_type" value="${((declaration.customs_type)?length>0)?string(declaration.customs_type,'通关无纸化')}" asValue=true />
            <!--对照2.0出口后添加箱唛、其他货源地和结汇方式-->
        <@h.label width="2" value=d.declarationType__?string("境内货源地","境内目的地") required=true />
        <@h.dropdown width="4" name="goods_addr_code" showName="goods_addr" value="${declaration.goods_addr_code}" showValue="${declaration.goods_addr}" />
        <@h.label width="2" value="其他货源地" />
        <@h.input width="3" name="other_goods_addr" value="${declaration.other_goods_addr}"/>
        <@h.label width="2" value="箱唛" />
        <@h.input width="3" name="carton" value="${((declaration.carton)?length > 0)?string(declaration.carton,'N/M')}"/>
        <@h.label width="2" value="备注" />
        <@h.input width="4" name="remark" value="${((declaration.remark)?length>0)?string(declaration.remark,'结汇,退税')}"/>
        </div>
    </div>
    <div class="ui error message"></div>
    <!--商品信息-->
<#include "test-order-goods.ftl" />
    <input type="hidden" name="total_money" value="${declaration.total_money}"/>
    <!--这个要跟在商品的table后面-->
</div>
<#-- </form>-->
